From: Jens Frank Date: Wed, 11 Aug 2004 22:24:06 +0000 (+0000) Subject: Prevent division-by-zero-errors. BUG#1007562 X-Git-Tag: 1.5.0alpha1~2410 X-Git-Url: http://git.cyclocoop.org/%28%5B%5E/404?a=commitdiff_plain;h=be0021f2955c32ef0199a9456519d1146f346200;p=lhc%2Fweb%2Fwiklou.git Prevent division-by-zero-errors. BUG#1007562 --- diff --git a/includes/Skin.php b/includes/Skin.php index 12aec53acb..712fa9e22c 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -1891,13 +1891,20 @@ class Skin { $alt = preg_replace( '/<[^>]*>/', '', $label); $alt = htmlspecialchars( $alt ); + $width = $height = 0; if ( $img->exists() ) { $width = $img->getWidth(); $height = $img->getHeight(); - } else { + } + if ( 0 == $width || 0 == $height ) + { $width = $height = 200; } + if ( $boxwidth == 0 ) + { + $boxwidth = 200; + } if ( $framed ) { // Use image dimensions, don't scale